<?php

namespace App\Models;


class ForwarderStat extends BaseModel
{
    protected $table = 'forwarder_stat';

    protected $fillable = [
        'forwarder_id',
        'score',
        'speed_score',
        'price_score',
        'serve_score',
        'follow',
        'order_sum',
        'turnover_sum',
        'order_sum',
        'tags',
    ];

    public function getTagsAttribute($value)
    {
        return $value ? json_decode($value, true) : [];
    }

    public function setTagsAttribute($value)
    {
        $this->attributes['tags'] = json_encode($value);
    }
}
